package top.zy.service.zymallgoodsservice.mq;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: HouZeYu
 * @Description:
 * @Date: Created in 16:40 2019/7/8
 */

@Component
public class SendMessageService {
    @Autowired
    private AmqpTemplate amqpTemplate;

    public void sendMessageToQueue(Long spuId,String queueType){
      amqpTemplate.convertAndSend("goods."+queueType,spuId);
    }
}
